home *** CD-ROM | disk | FTP | other *** search
- Path: news.ee.vill.edu!atangira
- From: atangira@monet.vill.edu (Arvind)
- Newsgroups: comp.lang.c
- Subject: Re: Help:what is wrong this code?
- Date: 14 Apr 1996 21:49:48 GMT
- Organization: Villanova University
- Message-ID: <4krrts$sc5@ftp.ee.vill.edu>
- References: <4k3p3q$n76@brahms.udel.edu> <4kk1ug$agm@umbc9.umbc.edu>
- NNTP-Posting-Host: monet.csc.vill.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Jonas J. Schlein (schlein@umbc.edu) wrote:
- : Yue-hong Zheng <yuehong@brahms.udel.edu> wrote:
- : |> Why it give me 0.0000?
- : |>
- : |> #include <stdio.h>
- : |> main () {
- : |> double a=9.008;
- : |> printf("%f\n",sqrt(a));
- : |> return 0;
- : |> }
-
- : Have you tried adding the line: #include <math.h>?
-
- Isn't it also true that one will have to link in the math library while
- compiling (-lm on UNIX, at the end of the command line) in order to use
- sqrt() or am I missing something?
-
- Arvind
-